home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
c
/
jpl_c.zip
/
GETS.C
< prev
next >
Wrap
Text File
|
1986-05-18
|
896b
|
31 lines
/* 1.0 12-17-84 */
/************************************************************************
* Robert C. Tausworthe *
* Jet Propulsion Laboratory *
* Pasadena, CA 91009 1984 *
************************************************************************/
#include "defs.h"
#include "stdtyp.h"
#include "stdio.h"
/************************************************************************/
STRING
gets(line) /* get line up to newline or EOF from stdin.
Return line if ok, NULL if empty and EOF. */
/*----------------------------------------------------------------------*/
STRING line;
{
FAST STRING s;
FAST int i;
s = line;
while (((i = getchar()) ISNT EOF) AND (i ISNT '\n'))
*s++ = i;
*s = NULL;
if ((i IS EOF) AND (s IS line))
return NULL;
return line;
}